Circulant embedding is a fast simulation method for stationary (possibly anisotropic) Gaussian random fields on regular grids based on Fourier transformations. It is garantueed to be an exact method for covariance functions with finite support, e.g. the spherical model. The method is admissible for any dimension apart from memory restictions. The simulation is performed on a torus which represents the bended grid. To remove wrong dependencies occuring at different borders of the grid which would be close on the torus, the simulation area is multiplied by a natural number. There is also a multivariate version of circulant embedding.
Cut-off embedding is a fast simulation method for stationary,
isotropic Gaussian random fields on square lattices based on
the standard RPcirculant
method,
so that exact simulation is garantueed
for further covariance models, e.g. the RMwhittle
model.
In fact, the circulant embedding is called with the cutoff
hypermodel, see RMcutoff
.
Cutoff
halfens the maximum number of
elements models used to define the covariance function of interest
(from 10 to 5).
Here multiplicative models are not allowed (yet).
For details see RMcutoff
.
Intrinsic embedding is a fast simulation method for intrinsically stationary,
isotropic Gaussian random fields on square lattices based on
the standard RPcirculant
method,
for further variogram models, e.g. RMfbm
.
Note that the simulated random field is always non-stationary.
In fact, the circulant embedding is called with the Intrinsic
hypermodel, see RMintrinsic
.
Here multiplicative models are not allowed (yet).
For details see RMintrinsic
.
RPcirculant(phi, boxcox, force, mmin, strategy, maxGB, maxmem, tolIm, tolRe, trials, useprimes, dependent, approx_step, approx_maxgrid)
RPcutoff(phi, boxcox, force, mmin, strategy, maxGB, maxmem, tolIm, tolRe, trials, useprimes, dependent, approx_step, approx_maxgrid, diameter, a)
RPintrinsic(phi, boxcox, force, mmin, strategy, maxGB, maxmem, tolIm, tolRe, trials, useprimes, dependent, approx_step, approx_maxgrid, diameter, rawR)
RPgauss
RFboxcox
for Details.
force=TRUE
) after trials
number of trials.
Default: FALSE
CE.mmin
determines the initial size of the circulant
matrix. If CE.mmin=0
the minimal starting size is
determined automatically according to the
dimensions of the grid.
If CE.mmin>0
then the absolute starting size is given.
If CE.mmin<0< code=""> then the automatically determined
matrix size is multiplied
by $|\code{CE.mmin}|$; here CE.mmin
must be smaller
than -1; the
value -1 takes over the minimal starting size.
Note: in any cases, the initial size might be increased according
to CE.useprimes
.
Default: 0
0<>
0
, if the circulant
matrix has negative eigenvalues then the
size in each direction is doubled; 1
: the size is
enhanced only in
one direction, namely that one where the covariance function has the
largest value at the end point of the grid --- note that
the default value of trials
is probably too small
in that case. In some cases strategy=0
works better, in other cases
strategy=1
. Just try. Clearly, if the field is
isotropic and a square grid should be simulated, then
strategy=0
is the better choice.
Default: 0
maxmem
is set to MAXINT.
Default: 1.
maxmem
must be at least $2^d$ times as large as
the number of points to be simulated. Here $d$ is the
space dimension. In some cases even much larger.
Note that maxmem
can be used to control the automatic
choice of the simulation algorithm. Namely, in case of huge
circulant matrices, other simulation
methods (TBM) might be faster and might be preferred by the user. If this argument is set then maxGB
is set to Inf
.
Default: MAXINT
tolIm
then the eigenvalue is always considered as
real (independently of the value of force
).
Default: 1E-3
tolRe
and 0 are always considered as
0 and set 0 (independently of the value of force
). Default: -1E-7
tolRe
and
tolIm
are missed then the matrix size is doubled
according to strategy
,
and the matrix is checked again. This procedure is repeated
up to trials - 1
times. If there are still negative
eigenvalues, the simulation method fails if force=FALSE
.
Default: 3
FALSE
the columns of the circulant matrix
have length $2^k$ for some $k$. Otherwise the algorithm
tries to find a nicely factorizable number close to the size of the
given matrix.
Default: TRUE
FALSE
then independent random fields are created. If TRUE
then at least 4 non-overlapping rectangles are taken out of the
the expanded grid defined by the circulant matrix.
These simulations are dependent.
See RFoptionsAdvanced for an example.
See trials
for some
more information on the circulant matrix. Default: FALSE
NA
then approx_step
is chosen such that
approx_maxgrid
is nearly reached. Default: NA
maxmem
.
RMcutoff
or RMintrinsic
RMcutoff
RMintrinsic
RMmodel
Cutoff and Intrinsic
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
model <- RMstable(s=1, alpha=1.8)
x <- seq(-3,3,0.1)
z <- RFsimulate(model=RPcirculant(model), x=x, y=x, n=1)
plot(z)
model <- RMexp(var=10, s=10)
z <- RFsimulate(model=RPcirculant(model), 1:10)
plot(z)
model <- RMfbm(Aniso=diag(c(1,2)), alpha=1.5)
z <- RFsimulate(model, x=1:10, y=1:10)
plot(z)
Run the code above in your browser using DataLab